package total;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Ques1893 {
	
	public void go(){
		
		Scanner scan = new Scanner(System.in);
		
		int n = scan.nextInt();
		List<String> resultList = new ArrayList<String>();
		outter : while(n > 0){
			String a = scan.next();
			String b = scan.next();
			int lenA = a.length();
			if(!a.contains(b)){
				resultList.add("Bob");
				n--;
				continue outter;
			}
			if(a.equals(b)){
				resultList.add("Alice");
				n--;
				continue outter;
			}
			String temp = a;
			boolean flag = true;
			if(temp.contains(b)){
				temp = temp.replaceAll(b, "0");
				while(temp.contains("0")){
					if(temp.indexOf("0") == lenA/2){
						resultList.add("Alice");
						n--;
						continue outter;
					}else{
						temp = temp.replaceFirst("0", "1");
					}
				}
			}
		
			temp = a;
			for(int i = 0;i < lenA;i ++){
				if(temp.contains(b)){
					temp = temp.replaceFirst(b, "0");
					if(temp.contains(b)){
						temp = temp.replaceFirst(b, "0");
						int len1 = temp.indexOf("0");
						int len2 = temp.lastIndexOf("0");
						if(len2 - len1 <= 2){
							if((len2 + len1) / 2 == temp.length() / 2){
								resultList.add("Alice");
								n--;
								continue outter;
							}
						}
					}
				}
			}
			resultList.add("Bob");
			n--;
			continue outter;
		}
		
		for(String str : resultList){
			System.out.println(str);
		}
	}
	
	public static void main(String[] args) {
		new Ques1893().go();
	}
}
